package indzcraft.ui;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;

public class BasicsPanel extends JPanel implements ActionListener {
	
	private static final long serialVersionUID = 1L;
	private IndzCraftUI icui = null;
	
	private JButton spec1;
	private JButton spec2;
	private JButton defaultCombat;
	private JButton defaultSubtlety;
	
	public BasicsPanel(IndzCraftUI ui){
		super();
		this.icui = ui;
		setLayout(null);
		
		JLabel lImported = new JLabel("Load imported Talents");
		lImported.setBounds(0,0,300,30);
		add(lImported);
		
		spec1 = new JButton(icui.getLoader().getBase().getTalentsName());
		spec1.setBounds(0,30,120,30);
		spec1.addActionListener(this);
		add(spec1);
		
		spec2 = new JButton(icui.getLoader().getBase().getOffTalentsName());
		spec2.setBounds(130,30,120,30);
		spec2.addActionListener(this);
		add(spec2);
		
		JLabel lDefault = new JLabel("Load default Talents");
		lDefault.setBounds(0,60,300,30);
		add(lDefault);
		
		defaultCombat = new JButton("Combat");
		defaultCombat.setBounds(0,90,120,30);
		defaultCombat.addActionListener(this);
		add(defaultCombat);
		
		defaultSubtlety = new JButton("Subtlety");
		defaultSubtlety.setBounds(130,90,120,30);
		defaultSubtlety.addActionListener(this);
		add(defaultSubtlety);
	}

	public void actionPerformed(ActionEvent e) {
		if(e.getSource() == spec1){
			icui.getSettings().setTalents(1);
		}else if(e.getSource() == spec2){
			icui.getSettings().setTalents(2);
		}else if(e.getSource() == defaultCombat){
			JOptionPane.showMessageDialog(icui, "Not implemented!",icui.getTitle(),JOptionPane.ERROR_MESSAGE);
		}else if(e.getSource() == defaultSubtlety){
			JOptionPane.showMessageDialog(icui, "Not implemented!",icui.getTitle(),JOptionPane.ERROR_MESSAGE);
		}
		
	}
}
